import type { RouteRecordRaw } from 'vue-router'

export const constantRoute: Array<RouteRecordRaw> = [
  // 路由配置
  {
    path: '/',
    component: () => import('@/views/home/index.vue'),
    meta: { show: true },
  },
  // 路由懒加载写法
  {
    name: 'home',
    path: '/home',
    component: () => import('@/views/home/index.vue'),
    meta: { show: true },
  },
  {
    name: 'list',
    path: '/list',
    component: () => import('@/views/list/index.vue'),
    meta: { show: true },
  },
  {
    name: 'details',
    path: '/details',
    component: () => import('@/views/details/index.vue'),
    meta: { show: true },
  },
  {
    name: 'cart',
    path: '/cart',
    component: () => import('@/views/cart/index.vue'),
    meta: { show: true },
  },
  {
    name: 'test',
    path: '/test',
    component: () => import('@/views/test/index.vue'),
    meta: { show: true },
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/home',
  },
]
